//
//  DeliveryViewController.h
//  OrderSeat
//
//  Created by haiming on 13-10-14.
//  Copyright (c) 2013年 wangwei. All rights reserved.
//

@protocol SelDeliveryDistanceDelegate

@required
- (void)selectedDistanceFinished:(NSDictionary *)dic;

@end

@class DeliveryDataSource;
@class SelDeliveryDistanceView;
@interface DeliveryViewController : BaseViewController<SelDeliveryDistanceDelegate>

@property (strong, nonatomic) IBOutlet UITableView *deliveryTable;
@property (strong, nonatomic) IBOutlet UIButton *titleButton;
@property (strong, nonatomic) SelDeliveryDistanceView *selectDistanceView;
@property (strong, nonatomic) NSString *selDistance;
@property (strong, nonatomic) DeliveryDataSource *dataSource;

@end

@interface DeliveryDataSource : BaseDataSource<UIScrollViewDelegate,UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, assign) int pageNumber;
@property (nonatomic, strong) NSMutableArray *deliveryList;
@property (nonatomic, strong) NSMutableArray *distanceList;
@property (nonatomic, strong) DeliveryViewController *viewController;

- (void)fetchDistance;
- (void)fetchDeliverysWithDistance:(NSString*)distance isLoadMore:(BOOL)isLoadMore;

@end

@interface SelDeliveryDistanceView : UIView<UITableViewDelegate,UITableViewDataSource>

@property (strong, nonatomic) UIImageView *backImage;
@property (strong, nonatomic) NSMutableArray *distanceList;
@property (strong, nonatomic) UITableView *distanceTable;
@property (strong, nonatomic) id<SelDeliveryDistanceDelegate> delegate;

- (void)showOrVisible;
- (void)loadDataWithArray:(NSMutableArray *)distance;

@end